package com.jzr.medical.common;

import java.util.ArrayList;
import java.util.List;


public class LayBatch<T extends LayEntity> {
    private List<T> adds;
    private List<T> updates;
    private List<T> deletes;

    public LayBatch(List<T> list){
        this.adds = this.getList(list,1);
        this.updates = this.getList(list,2);
        this.deletes = this.getList(list, 3);
    }

    public List<T> getList(List<T> list, int status){
        List<T> result = new ArrayList<>();
        for(T model : list){
            if(model.getLayRowStatus() == status){
                result.add(model);
            }
        }
        return result;
    }

    public List<T> getAdds(){
        return this.adds;
    }

    public List<T> getUpdates(){
        return this.updates;
    }
    public List<T> getDeletes(){
        return this.deletes;
    }

}
